using System.Collections.Generic;
using PetShop.BusinessEntities;
using PetShop.DataAccess.DAO;

namespace PetShop.BusinessEntityManagers
{
    public class ProductBO
    {
        public List<ProductInfo> GetProductsByCategory(string category)
        {
            if (category.Trim() == string.Empty)
                return null;
            var dal = new ProductDAO();
            return dal.GetProductsByCategory(category);
        }


        public List<ProductInfo> GetProductsBySearch(string text)
        {
            if (text.Trim() == string.Empty)
                return null;
            string[] keywords = text.Split();
            var dal = new ProductDAO();
            return dal.GetProductsBySearch(keywords);
        }
    }
}